home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-04
/
bipl.zip
/
PROGS.ZIP
/
GCOMP.ICN
< prev
next >
Wrap
Text File
|
1992-09-28
|
1KB
|
42 lines
############################################################################
#
# File: gcomp.icn
#
# Subject: Program to produce complement of file specification
#
# Author: William H. Mitchell, modified by Ralph E. Griswold
#
# Date: December 27, 1989
#
###########################################################################
#
# This program produces a list of the files in the current directory
# that do not appear among the arguments. For example,
#
# gcomp *.c
#
# produces a list of files in the current directory that do
# not end in .c. As another example, to remove all the files
# in the current directory that do not match Makefile, *.c, and *.h
# the following can be used:
#
# rm `gcomp Makefile *.c *.h`
#
# The files . and .. are not included in the output, but other
# `dot files' are.
#
############################################################################
#
# Requires: UNIX
#
############################################################################
procedure main(args)
local files
files := set()
read(open("echo * .*","rp")) ? while insert(files,tab(upto(' ') | 0)) do
move(1) | break
every delete(files,"." | ".." | !args)
every write(!sort(files))
end